package com.ruoyi.system.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MineUserAnswerMapper;
import com.ruoyi.system.domain.MineUserAnswer;
import com.ruoyi.system.service.IMineUserAnswerService;

/**
 * 用户作答Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-14
 */
@Service
public class MineUserAnswerServiceImpl implements IMineUserAnswerService 
{
    @Autowired
    private MineUserAnswerMapper mineUserAnswerMapper;

    /**
     * 查询用户作答
     * 
     * @param userId 用户作答主键
     * @return 用户作答
     */
    @Override
    public MineUserAnswer selectMineUserAnswerByUserId(Long userId)
    {
        return mineUserAnswerMapper.selectMineUserAnswerByUserId(userId);
    }

    /**
     * 查询用户作答
     *
     * @param examId 用户作答主键
     * @return 用户作答
     */
    @Override
    public List<MineUserAnswer> selectMineUserAnswerByExamId(@Param("examId") Long examId) {
        return mineUserAnswerMapper.selectMineUserAnswerByExamId(examId);
    }

    /**
     * 查询用户作答
     *
     * @param questionId 用户作答主键
     * @return 用户作答
     */
    @Override
    public List<MineUserAnswer> selectMineUserAnswerByQuestionId(Long questionId)
    {
        return mineUserAnswerMapper.selectMineUserAnswerByQuestionId(questionId);
    }


    /**
     * 查询用户作答列表
     * 
     * @param mineUserAnswer 用户作答
     * @return 用户作答
     */
    @Override
    public List<MineUserAnswer> selectMineUserAnswerList(MineUserAnswer mineUserAnswer)
    {
        return mineUserAnswerMapper.selectMineUserAnswerList(mineUserAnswer);
    }

    /**
     * 新增用户作答
     * 
     * @param mineUserAnswer 用户作答
     * @return 结果
     */
    @Override
    public int insertMineUserAnswer(MineUserAnswer mineUserAnswer)
    {
        return mineUserAnswerMapper.insertMineUserAnswer(mineUserAnswer);
    }

    /**
     * 修改用户作答
     * 
     * @param mineUserAnswer 用户作答
     * @return 结果
     */
    @Override
    public int updateMineUserAnswer(MineUserAnswer mineUserAnswer)
    {
        return mineUserAnswerMapper.updateMineUserAnswer(mineUserAnswer);
    }

    /**
     * 批量删除用户作答
     * 
     * @param userIds 需要删除的用户作答主键
     * @return 结果
     */
    @Override
    public int deleteMineUserAnswerByUserIds(Long[] userIds)
    {
        return mineUserAnswerMapper.deleteMineUserAnswerByUserIds(userIds);
    }

    /**
     * 删除用户作答信息
     * 
     * @param userId 用户作答主键
     * @return 结果
     */
    @Override
    public int deleteMineUserAnswerByUserId(Long userId)
    {
        return mineUserAnswerMapper.deleteMineUserAnswerByUserId(userId);
    }
}
